class Solution(object):
    def sortEvenOdd(self, nums):
        odd_num = nums[1::2]
        even_num = nums[::2]
        odd_num.sort(reverse=True)
        even_num.sort()
        n1 = len(even_num)
        n2 = len(odd_num)
        index1 = 0
        index2 = 0
        out = []
        while index1 < n1 and index2 < n2:
            out.append(even_num[index1])
            out.append(odd_num[index2])
            index1 += 1
            index2 += 1
        if index1 < n1:
            out.append(even_num[index1])
        return out


